home *** CD-ROM | disk | FTP | other *** search
- package com.extensibility.esc;
-
- import javax.swing.ListSelectionModel;
- import javax.swing.event.ListSelectionListener;
- import javax.swing.tree.DefaultTreeSelectionModel;
- import javax.swing.tree.TreePath;
-
- class JTreeTable$ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel {
- // $FF: synthetic field
- final JTreeTable this$0;
- protected boolean updatingListSelectionModel;
-
- public JTreeTable$ListToTreeSelectionModelWrapper(JTreeTable var1) {
- this.this$0 = var1;
- this.getListSelectionModel().addListSelectionListener(this.createListSelectionListener());
- }
-
- ListSelectionModel getListSelectionModel() {
- return super.listSelectionModel;
- }
-
- public void resetRowSelection() {
- if (!this.updatingListSelectionModel) {
- this.updatingListSelectionModel = true;
-
- try {
- super.resetRowSelection();
- } finally {
- this.updatingListSelectionModel = false;
- }
- }
-
- }
-
- protected ListSelectionListener createListSelectionListener() {
- return new JTreeTable.2(this);
- }
-
- protected void updateSelectedPathsFromSelectedRows() {
- if (!this.updatingListSelectionModel) {
- this.updatingListSelectionModel = true;
-
- try {
- int var1 = super.listSelectionModel.getMinSelectionIndex();
- int var2 = super.listSelectionModel.getMaxSelectionIndex();
- ((DefaultTreeSelectionModel)this).clearSelection();
- if (var1 != -1 && var2 != -1) {
- for(int var3 = var1; var3 <= var2; ++var3) {
- if (super.listSelectionModel.isSelectedIndex(var3)) {
- TreePath var4 = this.this$0.tree.getPathForRow(var3);
- if (var4 != null) {
- ((DefaultTreeSelectionModel)this).addSelectionPath(var4);
- }
- }
- }
- }
- } finally {
- this.updatingListSelectionModel = false;
- }
- }
-
- }
- }
-